package com.icat.house.web.controller;

import com.icat.house.common.CaptchaRender;
import com.jfinal.core.ActionKey;
import com.jfinal.ext.route.ControllerBind;

@ControllerBind(controllerKey = "/captcha")
public class CaptchaController extends BaseController {
	public static final int DEFAULT_CAPTCHA_LEN = 4;

	/**
	 * 验证码
	 */
	@ActionKey("/captcha")
	public void captcha() {
		CaptchaRender img = new CaptchaRender(DEFAULT_CAPTCHA_LEN);
		setSessionAttr(getPara("r"), img.getMd5RandonCode());
		render(img);
	}
}
